.TH IHR 1 "30 July 2002" "WFDB 10.2.7" "WFDB Applications Guide"
.SH NAME
ihr \- calculate instantaneous heart rate
.SH SYNOPSIS
\fBihr -r\fR \fIrecord\fR \fB-a\fR \fIannotator\fR [ \fIoptions\fR ... ]
.SH DESCRIPTION
.PP
\fBihr\fR reads an annotation file (specified by the \fIannotator\fR
and \fIrecord\fR arguments) and produces an instantaneous heart rate
signal (from the reciprocals of the interbeat intervals.)  Unlike
\fBtach\fR(1), however, \fBihr\fR does not resample its output in
order to obtain uniform time intervals between output samples.  (If
there is any variation whatsoever in heart rate, the intervals between
output samples will be non-uniform.)  This property makes the output
of \fBihr\fR unsuitable for conventional power spectral density estimation,
but ideal for PSD estimation using the Lomb periodogram (see \fBlomb\fR(1)).
.PP
\fIOptions\fR include:
.TP
\fB-d\fR \fItolerance\fR
Reject beat-to-beat heart rate changes exceeding \fItolerance\fR (in beats per
minute; default: 10).  Any intervals for which the calculated heart rate would
differ by more than the specified tolerance are simply excluded from the output
series.  To disable this behavior, use a large value for \fItolerance\fR
(e.g., 10000).
.TP
\fB-f\fR \fItime\fR
Begin at the specified \fItime\fR in \fIrecord\fR (default: the beginning of
\fIrecord\fR).
.TP
\fB-h\fR
Print a usage summary.
.TP
\fB-i\fR
Include all intervals bounded by QRS annotations (default: include intervals
bounded by consecutive supraventricular beats only).
.TP
\fB-p\fR \fItype\fR ...
Include intervals bounded by annotations of the specified \fItypes\fR only.
The \fItype\fR arguments
should be annotation mnemonics (e.g., \fBN\fR) as normally printed by
\fBrdann\fR(1) in the third column.  More than one \fB-p\fR option may be used
in a single command, and each \fB-p\fR option may have more than one \fItype\fR
argument following it.  If \fItype\fR begins with ``-'', however, it must
immediately follow \fB-p\fR (standard annotation mnemonics do not begin with
``-'', but modification labels in an annotation file may define such
mnemonics).
.TP
\fB-t\fR \fItime\fR
Process until the specified \fItime\fR in \fIrecord\fR (default: the end of the
\fIrecord\fR).
.TP
\fB-v\fR
Print the output sample number before each output sample value.
.TP
\fB-v\fR, \fB-vs\fR, \fB-vm\fR, \fB-vh\fR, \fB-V\fR, \fB-Vs\fR, \fB-Vm\fR, \fB-Vh\fR
Print the elapsed times from the beginning of the record to the annotations
that begin each interval, as sample number (using \fB-v\fR), or in seconds
(using \fB-vs\fR), minutes (using \fB-vm\fR), or hours (using \fB-vh\fR)
before each heart rate value.  The options \fB-V\fR, \fB-Vs\fR, \fB-Vm\fR, and
\fB-Vh\fR work in the same way, but the printed times are those for the
annotations that end the intervals.  Only one of these options can be used at
a time;  if none is chosen, \fB-vs\fR mode is used by default.
.TP
\fB-x\fR
Exclude the interval immediately following each rejected interval.  (Rejected
intervals are those bounded by excluded beats on at least one end, and those
that do not satisfy the \fItolerance\fR criterion).  By default, intervals
following rejected intervals are included (unless they are rejected by the
\fItolerance\fR criterion), and a third column is used to flag these intervals
(a zero in the third column means the interval is normal, a one means it
follows an excluded interval).
.PP
Reference (`atr') annotation files can be used as input to \fBihr\fR,
but files that contain manually-inserted annotations are less suitable,
since annotation placement is likely to be less consistent than in annotation
files generated by programs such as \fBsqrs\fR(1). 
.SH ENVIRONMENT
.PP
It may be necessary to set and export the shell variable \fBWFDB\fR (see
\fBsetwfdb\fR(1)).
.SH SEE ALSO
\fBlomb\fR(1), \fBsetwfdb\fR(1), \fBsqrs\fR(1), \fBtach\fR(1)
.SH AUTHOR
George B. Moody (george@mit.edu)
.SH SOURCE
http://www.physionet.org/physiotools/wfdb/app/ihr.c
